{include file="$header" /}
<div class="mk-app-warp">
    <mk-table
        url="userGroup/index"
        save-url="userGroup/save"
        update-url="userGroup/update"
        delete-url="userGroup/delete"
        :field="field"
        :date-search="false"
        tree
        expand>
    </mk-table>
</div>
{include file="$component" /}
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                field: [
                    {
                        prop: 'title', 
                        label: '名称', 
                        placeholder: '请输入标题', 
                        rules: {required: true},
                        sortable: 'custom', 
                    },
                    {
                        prop: 'pid', 
                        label: '父级', 
                        type: 'select',
                        option: [], 
                        self: true, 
                        tree: true, 
                        props:{label: 'title', value: 'id'}, 
                        rules: {required: true},
                        table: false, 
                    },
                    {
                        prop: 'integral', 
                        label: '积分', 
                        rules: {required: true},
                        sortable: 'custom', 
                    },
                    {
                        prop: 'default', 
                        label: '默认',  
                        type: 'switch', 
                        default: 0,
                        table: false, 
                    },
                    {
                        prop: 'status', 
                        label: '状态',  
                        type: 'switch', 
                        default: 1,
                        rules: {required: true},
                        width: '100px', 
                    },
                ]
            }
        },
    })
</script>
{include file="$footer" /}